package main

func main() {
	//n := 12

	//println(numSquares1(n))

	//str := "asdfasfa"
	//for _, i := range str {
	//
	//}
}

func numSquares1(n int) int {
	dps := make([]int, n+1)

	dps[0] = 0
	dps[1] = 1

	for i := 2; i <= n; i++ {
		minCombine := n
		for j := 1; j*j <= i; j++ {
			minCombine = minInt5(1+dps[i-j*j], minCombine)
		}
		dps[i] = minCombine
	}

	return dps[n]
}

func minInt5(int1, int2 int) int {
	if int1 > int2 {
		return int2
	}
	return int1
}
